package com.cmc.cloud.cmclink.doc.api.document.rep;

import com.cmc.cloud.cmclink.doc.api.document.req.si.BlnoCntrUpdateReqDto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;

import static com.cmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * @author 申天青
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "BLNO信息查询")
public class BlnoPageRespDto {

    @Schema(description = "si主表id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long blnoId;

    @Schema(description = "so主表id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long soId;

    @Schema(description = "订舱号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String bookingNo;

    @Schema(description = "提单号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String blNo;

    @Schema(description = "订舱船名", requiredMode = Schema.RequiredMode.REQUIRED)
    private String vesselCode;

    @Schema(description = "订舱航次", requiredMode = Schema.RequiredMode.REQUIRED)
    private String voyage;

    @Schema(description = "出口航线代码", requiredMode = Schema.RequiredMode.REQUIRED)
    private String laneCodeEx;

    @Schema(description = "进口航线代码", requiredMode = Schema.RequiredMode.REQUIRED)
    private String laneCodeIm;

    @Schema(description = "接货地", requiredMode = Schema.RequiredMode.REQUIRED)
    private String porCode;

    @Schema(description = "装货港", requiredMode = Schema.RequiredMode.REQUIRED)
    private String polCode;

    @Schema(description = "卸货港", requiredMode = Schema.RequiredMode.REQUIRED)
    private String podCode;

    @Schema(description = "接货地描述", requiredMode = Schema.RequiredMode.REQUIRED)
    private String porDesc;

    @Schema(description = "装货港描述", requiredMode = Schema.RequiredMode.REQUIRED)
    private String polDesc;

    @Schema(description = "目的地")
    private String delCode;

    @Schema(description = "协议号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String agreementNo;

    @Schema(description = "始发港提单状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    private String siStatus;

    @Schema(description = "货类", example = "2")
    private String cargoType;

    @Schema(description = "提单拆并单类型 默认类型:N 拆分单:N->S或者是C->S  合并单:C", example = "2")
    private String splitCombineType;

    @Schema(description = "更正状态", example = "2")
    private String siChangeStatus;

    @Schema(description = "申请签单类型 ", example = "B")
    private String signOrder;

    @Schema(description = "实际签单类型 ", example = "B")
    private String signType;

    @Schema(description = "是否可拆分 ", example = "2")
    private Boolean canSplit;

    @Schema(description = "是否可合并", example = "2")
    private Boolean canCombine;

    @Schema(description = "拆分,合并，更正操作类型 ", example = "Split/Combine/Change")
    private String operationType;

    @Schema(description = "拆并,更正审批状态", example = "Rejected/Pending/Approved")
    private String approveStatus;

    @Schema(description = "是否可以发起更正申请", example = "True")
    private Boolean canChangeFlag;

    @Schema(description = "箱信息", example = "2")
    private List<BlnoCntrUpdateReqDto> blnoCntrs;

    @Schema(description = "发货人信息")
    private List<BlnoScnRespDto> shipperList;

    @Schema(description = "更新时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @Schema(description = "扣单标识")
    private Boolean restrictionFlag;

    @Schema(description = "提单类型")
    private String blType;

    @Schema(description = "签单日期")
    private LocalDate issueDate;

    @Schema(description = "锁单标识")
    private Boolean blLockFlag;

    @Schema(description = "锁船标识")
    private Boolean blShipperLockFlag;

    @Schema(description = "订舱人代码")
    private String bkpCode;

    @Schema(description = "是否是船期修改")
    private Boolean blShipperChangeFlag;

    @Schema(description = "合并单ID")
    private Long combineBlnoId;

    @Schema(description = "是否是北方四港")
    private boolean manifestFlag;

    @Schema(description = "一级代理")
    private String topAgentCode;
}